
if( SERVER ) then
   
 	AddCSLuaFile( "shared.lua" ) 
 	SWEP.HoldType = "pistol";
 
 end 

if( CLIENT ) then

	
	SWEP.ViewModelFlip	= true	
	SWEP.CSMuzzleFlashes	= true
	
	SWEP.DrawCrosshair = false;

end
 
 SWEP.Base = "ts2_base";
   
 SWEP.Spawnable			= false 
 SWEP.AdminSpawnable		= false 
   
SWEP.Primary.Sound = Sound( "weapons/k98_shoot2.wav" );

SWEP.WorldModel = "models/weapons/w_dragunov__.mdl";
SWEP.ViewModel = "models/weapons/v_dragunov__.mdl";

SWEP.PrintName = "SVD Dragunov";
SWEP.TS2Desc = "Russian military issue Sniper Rifle.";

 SWEP.Primary.Recoil			= .1
 SWEP.Primary.RecoilAdd			= 1;
 SWEP.Primary.RecoilMin = .1
 SWEP.Primary.RecoilMax = 3
 
 SWEP.Primary.ViewPunchMul = 2;
 SWEP.Primary.Damage			= 15
 SWEP.Primary.NumShots		= 1 
 
 SWEP.TS2HoldType = "RIFLE";

SWEP.Primary.DoorBreach = false;
SWEP.Primary.HighPowered = true;
SWEP.Primary.ClipSize = 10;
SWEP.Primary.DefaultClip = 10;
SWEP.Primary.Ammo = "smg1";
SWEP.Primary.Delay = 0.7;
SWEP.Primary.Automatic = false;
SWEP.Primary.SpreadCone = Vector( .0, .0, .0 );
 SWEP.Primary.ReloadDelay = 2.5;
 
 SWEP.Primary.IronSightPos = Vector( -3.5, 0.0, -13.0 );
 SWEP.Primary.IronSightAng = Vector( 0.0, 0.0, 0.0 );

SWEP.Primary.HolsteredPos = Vector( 0.8, -5.0, -2.0 );
SWEP.Primary.HolsteredAng = Vector( 0.0, 40.0, 0.0 );

 SWEP.ItemWidth = 3;
 SWEP.ItemHeight = 1;

SWEP.IconCamPos = Vector( 22, 78, 5 );
SWEP.IconLookAt = Vector( 0, -23, -2 );
SWEP.IconFOV = 10;

SWEP.Price = 2000

function SWEP:HolsterToggle()

	self.Owner:ConCommand( "eng_seescope 0\n" );

end

if( CLIENT ) then

	SeeSniperScope = false;
	local ScopeTexture = surface.GetTextureID( "crosshair" );

	function SWEP:DrawHUD()

		if( math.floor( self.Primary.PositionMode ) == 1 and math.floor( self.Primary.PositionMul ) == 1 ) then 

			if( not SeeSniperScope ) then
			
				RunConsoleCommand( "eng_seescope", "1" );
				SeeSniperScope = true;

			end

			local x = ( ScrW() - 1024 ) * .5;
			local y = ( ScrH() - 1024 ) * .5;
			local w = 1024;
			if( w < ScrW() ) then x = 0; w = ScrW(); end
			local h = 1024;
			if( h < ScrH() ) then y = 0; h = ScrH(); end
			
			surface.SetTexture( ScopeTexture );
			surface.SetDrawColor( 255, 255, 255, 255 );
			surface.DrawTexturedRect( x, y, w, h );	
			
			
		
		end
		
		
	end

end


   